
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
</html>
<script>
    let person = {
        name:'李大师',
        age:231
    }
    let p = new Proxy(person,{
         // 获取值 
        get(target,attribute){
            console.log(target,attribute,Reflect,'获取')
            // return target[attribute]
            //   Reflect 映射
            return Reflect.get(target,attribute)
        },
        // 设置值 对于 增 改 生效
        set(target,attribute,value){
            console.log(target,attribute,value,'设置')
            // return target[attribute] = value 
            return Reflect.set(target,attribute,value)
        },
        // 删除值
        deleteProperty(target,attribute){
            console.log(target,attribute)
            // return delete target[attribute]
            return Reflect.deleteProperty(target,attribute)
        }
    })  


</script>